package com.txf.simple.ui.activity;

import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.VideoView;

import com.txf.simple.R;
import com.txf.simple.tools.Logger;
import com.txf.simple.ui.widget.MarqueeView;

import java.util.ArrayList;
import java.util.List;

public class ADActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ad);
        MarqueeView marqueeView = (MarqueeView) findViewById(R.id.marqueeView);
        List<String> info = new ArrayList<>();
        info.add("公告测试 第一条");
        info.add("公告测试 第二条");
        info.add("公告测试 第三条");
        info.add("公告测试 第四条");
        info.add("公告测试 第五条");
        info.add("公告测试 第六条");
        marqueeView.startWithList(info);
        VideoView mVideoView = (VideoView) findViewById(R.id.videoView);
        mVideoView.setVideoURI(Uri.parse("http://mp4.res.hunantv.com/video/1021/7dd45c58d06e3d02c7b6883f729016cb.mp4"));
        mVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
            @Override
            public void onCompletion(MediaPlayer mp) {
                Logger.i("播放完成");
            }
        });
        mVideoView.start();
    }
}
